﻿using GameView.ViewModels;
using System.Windows.Controls;

namespace GameView.Views
{
    /// <summary>
    /// MsgViewDialogView.xaml 的交互逻辑
    /// </summary>
    public partial class MsgViewDialogView : UserControl
    {
        public MsgViewDialogView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 3001成功;3002失败;3003取消;3004提示
        /// </summary>
        /// <param name="tile"></param>
        /// <param name="type"></param>
        /// <param name="msg"></param>
        public MsgViewDialogView(string tile, int type, string msg)
        {
            InitializeComponent();
            var Data = new MsgViewDialogViewModel(tile, type, msg);
            DataContext = Data;
        }

        /// <summary>
        /// 3001成功;3002失败;3003取消;3004提示
        /// </summary>
        /// <param name="tile"></param>
        /// <param name="type"></param>
        /// <param name="msg"></param>
        public MsgViewDialogView(string tile, int type, string msg, string data, string msg1)
        {
            InitializeComponent();
            var Data = new MsgViewDialogViewModel(tile, type, msg, data, msg1);
            DataContext = Data;
        }

        /// <summary>
        /// 3001成功;3002失败;3003取消;3004提示
        /// </summary>
        /// <param name="tile"></param>
        /// <param name="type"></param>
        /// <param name="msg"></param>
        public MsgViewDialogView(string tile, int type, string msg, string data, string msg1, string data1, string msg2)
        {
            InitializeComponent();
            var Data = new MsgViewDialogViewModel(tile, type, msg, data, msg1, data1, msg2);
            DataContext = Data;
        }

        public void SetPP(string pp)
        {
            var dd = (MsgViewDialogViewModel)DataContext;
            dd.pp = pp;
        }

        public void SetHasCancel(bool isHave)
        {
            var dd = (MsgViewDialogViewModel)DataContext;
            dd.HasCancel = isHave;
        }
    }
}